const types = [
  { label: '注册送', value: 1 },
  { label: '分享送', value: 2 },
  { label: '浏览送', value: 3 },
  { label: '抽奖送', value: 4 },
]

export const columns = [
  { label: '', prop: 'index', width: '80px', type: 'index' },
  { label: '活动名称', prop: 'name', width: '120px' },
  { label: '活动类型', prop: 'type', type: 'select', options: types, width: '150px' },
  { label: '开始时间', prop: 'startTime', type: 'datetime', width: '150px' },
  { label: '结束时间', prop: 'endTime', type: 'datetime', width: '150px' },
  { label: '参与次数', prop: 'maxPerUser', type: 'number', width: '120px' },
  {
    label: '活动频率',
    prop: 'frequency',
    type: 'select',
    // O:次，D:天，M:月，Y:年
    options: [
      { label: '次', value: 'O' },
      { label: '天', value: 'D' },
      { label: '月', value: 'M' },
      { label: '年', value: 'Y' },
    ],
    width: '120px',
  },
  { label: '操作', prop: 'action', slotName: 'action', width: '100px', fixed: 'right' },
]

export const formOptions = [
  { label: '活动名称', prop: 'name' },
  {
    label: '活动类型',
    prop: 'type',
    type: 'select',
    options: types,
    rules: [{ required: true, message: '活动类型不能为空' }],
  },
  { label: '开始时间', prop: 'startTime', type: 'datetime', rules: [{ required: true, message: '开始时间不能为空' }] },
  { label: '结束时间', prop: 'endTime', type: 'datetime' },
  { label: '参与次数', prop: 'maxPerUser', type: 'number' },
  {
    label: '活动频率',
    prop: 'frequency',
    type: 'select',
    // O:次，D:天，M:月，Y:年
    options: [
      { label: '次', value: 'O' },
      { label: '天', value: 'D' },
      { label: '月', value: 'M' },
      { label: '年', value: 'Y' },
    ],
  },
  { label: '活动图片', prop: 'imageUrl', type: 'image', limit: 1, span: 3 },
  { label: '活动简介', prop: 'description', type: 'textarea', span: 3 },
]
